#pragma once

using std::cout;
using std::endl;

class Context
{
private:
    int m_Num;

public:
    Context(int num) { m_Num = num; }

public:
    void SetNum(int num) { m_Num = num; }
    int GetNum() { return m_Num; }
};

class IExpression
{
public:
    virtual void interpret(Context* context) = 0;
};

class CPlus : public IExpression
{
public:
    virtual void interpret(Context* context)
    {
        int num = context->GetNum();
        num++;
        context->SetNum(num);
    }
};

class CMinus : public IExpression
{
public:
    virtual void interpret(Context* context)
    {
        int num = context->GetNum();
        num--;
        context->SetNum(num);
    }
};